	<%@ page language="java" contentType="text/html; charset=UTF-8"%>
 <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<%
	String path = request.getContextPath();
	String basepath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
		<link rel="stylesheet" type="text/css"
			href="<%=basepath%>admin/flexigrid/css/flexigrid_gray.css">
		<link rel="stylesheet" type="text/css"
			href="<%=basepath%>admin/flexigrid/jqModal/css/jqModal_gray.css">
		<script type="text/javascript" src="<%=basepath%>admin/flexigrid/jquery-1.3.2.min.js"></script>
		<script type="text/javascript" src="<%=basepath%>admin/flexigrid/flexigrid.js"></script>
		<script type="text/javascript" src="<%=basepath%>admin/flexigrid/jqModal/dimensions.js"></script>
		<script type="text/javascript" src="<%=basepath%>admin/flexigrid/jqModal/jqDnR.js"></script>
		<script type="text/javascript" src="<%=basepath%>admin/flexigrid/jqModal/jqModal.js"></script>

		<script type="text/javascript">
 function keshi()
	{
	 var value=$('#queryType').val();
	  var url="<%=basepath%>querykeshiByHospitalkeshiAction?value="+value; 
	  location.href=url; 
	}
	function zhuanjia()
	{
	    var value=$("#city").find("option:selected").text();
	  var url="<%=basepath%>queryZhuanjiaByKeshizhuanjiaAction?value="+value; 
	  location.href=url; 
	}
	

	
 </script>	
 <!-- ajax异步加载二级联动菜单 -->
 <script type="text/javascript">
  //创建连接，判断浏览器 
    var http_request=false; 
    function createXMLHttpRequest()
    { 
	    if(window.XMLHttpRequest)
	    { 
	      XMLHttpReq=new XMLHttpRequest(); //创建对象对应不同的浏览器
	    } 
	    else if(window.ActiveXObject)
	    { 
		      try
		      { 
		         XMLHttpReq=new ActiveXObject("Msxml2.XMLHTTP"); 
		      }
		      catch(e)
		      { 
		
			      try
			      { 
			         XMLHttpReq=new ActiveXObject("Microsoft.XMLHTTP"); 
			      }
			      catch(e)
			      { 
			
			      } 
	
	        } 
	    } 

    } 

//onchange事件 
    function changeProvice(){//当第一个下拉框的选项发生改变时调用该函数
    //var province=document.getElementById("provice").value; //获取第一级菜单的值
    var province=$('#provice').val();

    sendRequest("<%=basepath%>ajaxKeshikeshiAction?province="+province); //发送参数到SERVLET
//值得注意的是URL的servlet地址前面不加“/”并且为小写字母（试验的结论）
    } 
    //发送请求 
    function sendRequest(url){ //发送函数
    createXMLHttpRequest(); 
    XMLHttpReq.open("GET",url,true); 
    XMLHttpReq.onreadystatechange=progessRequest;//调用相关的XML接受函数 
    XMLHttpReq.send(null); 
    } 

//判断接收请求 
    function progessRequest(){ 
    if(XMLHttpReq.readyState==4){ 
    if(XMLHttpReq.status==200){ 
         var xmlDoc=XMLHttpReq.responseXML; //获取返回的XML文档
         var citys=xmlDoc.getElementsByTagName("city");//获取XML节点
         var obj=document.getElementById("city");//获取第二级菜单的对象
    if(obj!=null)
    {//如果不为空就置空 
           obj.options.length=0; 
         } 

      for(var i=0;i<citys.length;i++){//用循环给select中加值 

         var xValue = citys[i].childNodes[0].firstChild.nodeValue;

         var xText = citys[i].childNodes[1].firstChild.nodeValue;

         var option = new Option(xText, xValue);

      try{

         obj.add(option);

      }catch(e){}

      } 

    }else{ 

    alert( "请求异常"+XMLHttpReq.responseText); 

    } 

    } 
   } 
  </script>
</head>
<body>
<!--  
                        <select id="provice" name="provice" onchange="changeProvice()" style="background-color: #D0E5F5;width: 200px;">
                            <option value="id">选择医院</option>
                            <c:forEach items="${hs}" var="hs">
                            <option>${hs.name }</option>
                            </c:forEach>
                        </select>
                    <br/>
                     
                        <select name="city" id="city" onchange="zhuanjia()" style="background-color: #D0E5F5;width:200px;">
                            <option value="0">
                                                                       请选择
                        </option>
                        </select>
                 
    	-->
    	 <table id="flex3" style="display: none">
	     
	       </table>   
        <script type="text/javascript">   
            $("#flex3").flexigrid    
            (    
            {    
            url: '<%=basepath%>flexkskeshiAction',
            dataType: 'json',
             colModel : [
		        {display:'编号',name:'id',width:100,sortable:true,align:'center'},
		            {
			            display : '科室',
			            name : 'keshi',
			            width : 150,
			            sortable : true,
			            align : 'center'
		            }
		            , 
		            {
			            display : '专家',
			            name : 'zhuanjia',
			            width : 150,
			            sortable : true,
			            align : 'center'
		            }
		            , 
		            {
			            display : '预约次数',
			            name : 'yuyue',
			            width : 100,
			            sortable : true,
			            align : 'center'
		            }, 
		            {
			            display : '就诊次数',
			            name : 'jiuzhen',
			            width : 100,
			            sortable : true,
			            align : 'center'
		            }
		       , 
		            {
			            display : '成功率',
			            name : 'suc',
			            width : 100,
			            sortable : true,
			            align : 'center'
		            }
		            ],
                usepager: true,  
                title: '科室统计',
                useRp: true,  
                page:1,//默认当前页
		        total:1,//总页数
		        rp : 10,//每页默认的结果数
                 
		        rpOptions:[5,10,15,20,25,30,50,100],
		        procmsg:'正在处理,请等待......',
		        nomsg:'没有数据',
		        hideOnSubmit:true,//隐藏提交
		        autoload:true,//自动加载
		        blockOpacity:0.5,//透明度设置  
             checkbox : false,// 是否要多选框  
            showTableToggleBtn: true,    
            width: 800,    
            height: 400    
            }    
            );    
                
            function test(com,grid)    
            {    
                if (com=='Delete')    
                    {    
                        confirm('Delete ' + $('.trSelected',grid).length + ' items?')    
                    }    
                else if (com=='Add')    
                    {    
                        alert('Add New Item');    
                    }               
            }    
   
        </script> 
</body>
</html>